<?php

namespace app\validate;

use think\Validate;
class PublicValidate extends Validate
{
    protected $rule = [
        'order_person_id|证书id' =>['require'],
    ];


    public function sceneAddRule()
    {
        return $this->only(['certificate_id','uid','org_id','start_date','end_date'])
            ->append('certificate_id|证书id','require')
            ->append ('uid|用户id或部门id' , 'requireWithout:org_id')
            ->append ('org_id|用户id或部门id' , 'requireWithout:uid')
            ->append('start_dates|时间区间','require|date');
    }
}